package com.cskaoyan.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 请求头限定
 * @author stone
 * @date 2021/11/22 16:04
 */
@RequestMapping("header/limit")
@Controller
public class RequestHeaderLimitController {

    @RequestMapping(value = "double", headers = {"aaa", "bbb"})
    @ResponseBody
    public String doubleHeader() {
        return "header contains aaa and bbb";
    }

    @RequestMapping(value = "consumes", consumes = "aaa/bbb")
    @ResponseBody
    public String consumes() {
        return "Content-Type !";
    }
    @RequestMapping(value = "produces", produces = "ccc/ddd")
    @ResponseBody
    public String produces() {
        return "Accept !";
    }

}
